package com.example.springbootlearn.netty.baseasr;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum CodeEnum {

    PRIVATE_TX_ASR("5001"),
    PUBLIC_TX_ASR("5002"),
    SUIYAN_ASR("5003"),
    OTHER("5010");

    private final String value;

    public static CodeEnum getEnumByValue(String value) {
        return Arrays.stream(values())
                .filter(x -> x.getValue().equals(value))
                .findFirst().orElse(null);
    }

}